//
//  XTStrategyCollectionViewCell.m
//  BeautifulHome
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 ACE. All rights reserved.
//

#import "XTStrategyCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation XTStrategyCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 图片
        self.pic = [[UIImageView alloc] init];
        [self.contentView addSubview:_pic];
        [_pic release];
    }
    return self;
}
#warning 布局信息方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _pic.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.height);
}
#warning model对象setter方法 用来给控件赋值
-(void)setPhoto:(XTCollectionViewPhotos *)photo
{
    if (_photo != photo) {
        [_photo release];
        _photo = [photo retain];
    }
    [_pic sd_setImageWithURL:[NSURL URLWithString:photo.url]];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
